Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SELA end2end #1621

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

SELA end2end #1621

wants to merge 7 commits into from

Conversation

Trustccc
Copy link

@Trustccc Trustccc commented Dec 3, 2024

Features

  • Added an end2end function to streamline the SELA process.
  • Modified the parameters of related functions to accommodate the new end-to-end functionality.
  • Updated the calling functions to ensure compatibility with the new end-to-end architecture.

Influence

  • This update will significantly reduce the complexity of the SELA process by automating multiple steps.
  • The new end2end function will allow for faster deployment and testing of SELA workflows, potentially improving overall system performance.

Other

  • This PR includes refactoring of several existing functions to ensure compatibility with the new end2end function.

metagpt/ext/sela/end2end_demo.py Outdated Show resolved Hide resolved
metagpt/ext/sela/end2end_demo.py Outdated Show resolved Hide resolved
metagpt/ext/sela/end2end_demo.py Outdated Show resolved Hide resolved
metagpt/ext/sela/end2end_demo.py Outdated Show resolved Hide resolved
@garylin2099
Copy link
Collaborator

garylin2099 commented Dec 4, 2024

  1. use pre-commit for formatting
  2. improve README, add a quick start section
  3. write PR description

…y`, and modified the related calling functions, and updated the README.md.
metagpt/ext/sela/run_sela.py Show resolved Hide resolved
metagpt/ext/sela/run_sela.py Outdated Show resolved Hide resolved
Extract and parse JSON content from the given string.
"""
try:
return json.loads(json_string[json_string.find("{") : json_string.rfind("}") + 1])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can ask the LLM to generate a ```json block and use metagpt.utils.common.CodeParser.parse_code to parse it

metagpt/ext/sela/end2end_demo.py Outdated Show resolved Hide resolved
metagpt/ext/sela/runner/sela.py Outdated Show resolved Hide resolved
metagpt/ext/sela/runner/sela.py Outdated Show resolved Hide resolved
@hohoCode
Copy link

hohoCode commented Dec 4, 2024

Great work and cannot wait to try it when ready.

Just a general comment: can you make sure o1 is also fully supported with SELA? Because currently it seems o1 with metagpt's examples/customized_agents is having some combability issue.

@garylin2099
Copy link
Collaborator

Great work and cannot wait to try it when ready.

Just a general comments: can you make sure o1 is also fully supported with SELA? Because currently it seems o1 with metagpt's examples/customized_agents is having some combability issue.

Thanks for your interest! We will test SELA with o1 and see if it works. Btw, SELA is able to achieve competitive performance even with deepseek, I assume you want to see if o1 can push up the limit further, or are there other considerations?

@hohoCode
Copy link

hohoCode commented Dec 5, 2024

@garylin2099 Thanks! Yeah cannot wait to test its limits!

"use_fixed_insights": False,
"low_is_better": False,
"start_task_id": 2,
"from_scratch": False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the default config, maybe set from_scratch to be True since it's an end-to-end task and no insights are pre-generated

"Report rmse on the eval data. Do not plot or make any visualizations."
)

data_dir = "/home/coder/project/chenxin/MetaGPT/metagpt/ext/sela/data/SELA-datasets/05_house-prices-advanced-regression-techniques"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this data dir

if datasets_dir.rpartition("/")[-1] == dataset["dataset"]:
data_path = datasets_dir
else:
data_path = os.path.join(datasets_dir, dataset["dataset"])
split_datasets = {
"train": os.path.join(data_path, "split_train.csv"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use Path from pathlib instead of os.path

…y`, and modified the related calling functions, and updated the README.md.
# Conflicts:
#	metagpt/ext/sela/README.md
#	metagpt/ext/sela/data/dataset.py
#	metagpt/ext/sela/run_sela.py
#	metagpt/ext/sela/runner/sela.py
Extract and parse JSON content from the given string using CodeParser.
"""
try:
json_code = CodeParser.parse_code("", json_string, "json")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont need try except, let the error be raise up

from metagpt.llm import LLM
from metagpt.utils.common import CodeParser

SELA_INSTRUCTION = """
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQ_PARSING_PROMPT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants